<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page language="java" import="java.util.*"%>
<%@ page  import="javax.servlet.http.HttpSession, 
				  javax.servlet.http.HttpServletRequest,
				  javax.servlet.http.HttpServletResponse,
				  com.ejoysoft.util.ParamUtil,
				  com.ejoysoft.common.exception.IdObjectException,
				  com.ejoysoft.wlanyz.business.Latlng,
				  java.text.*,
				  com.ejoysoft.wlanyz.business.Paper
				  "
				  %>
<%@page import="com.ejoysoft.common.exception.NoRightException"%>
<%@page import="com.ejoysoft.wlanyz.business.Latlng,com.ejoysoft.common.Constants,com.ejoysoft.util.ParamUtil,com.ejoysoft.wlanyz.system.SysUserUnit"%>
<%@page import="javax.script.ScriptEngineManager"%>
<%@page import="javax.script.ScriptEngine"%>
<%@page import="java.math.BigDecimal"%>
<%@page import="com.sun.org.apache.bcel.internal.generic.NEW"%>
<%@page import="com.ejoysoft.wlanyz.business.Ac"%>
<%@ include file="../include/jsp/head.jsp"%>
<%
if(!globa.userSession.hasRight("30005"))
      throw new NoRightException("用户不具备操作该功能模块的权限，请与系统管理员联系！");

String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
 Paper paper = new Paper(globa);
 Latlng obj=new Latlng(globa,false);
 String strCity = ParamUtil.getString(request,"strCity","").trim();//获取城市
 String strCountry = ParamUtil.getString(request,"strCountry","").trim();//获取区县
 String strClassOneAc = ParamUtil.getString(request,"strClassOneAc","").trim();//获取一级热点
 
//  Latlng obj0=obj.show(where);
String tWhere = " where 1=1 ";
if(!strCity.equals(""))tWhere += " and acname in (select strid from ac_class_associate where strcity = '"+strCity+"' )";
if(!strCountry.equals(""))tWhere += " and acname in (select strid from ac_class_associate where strcountry = '"+strCountry+"' )";
if(!strClassOneAc.equals("")) tWhere += " and acname in (select strid from ac_class_associate where classoneac = '"+strClassOneAc+"' )";

Vector<Latlng> vctObj=obj.list(tWhere,0,0);
	//获取当前页的记录条数
int intVct=(vctObj!=null&&vctObj.size()>0?vctObj.size():0);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html>
<head>
<link href="../common/css/css.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><style type="text/css">
<!-- 
body {
	background-color: #FFFFFF; font-size:12px;
}
.sel1{ width:160px;}
.t2{font-size:14px; color:#000000}
.t1{font-size:12px;}
.t21 {font-size:14px; color:#000000}

.mesWindow{border:#666 0px solid;background:#fff}
.mesWindowTop{border:#eee 0px solid;margin-left:0px;padding:0px;font-weight:bold;text-align:left;font-size:12px;}
.mesWindowContent{margin:0px;font-size:12px;}
.mesWindow .close{height:15px;width:28px;border:none;cursor:pointer;text-decoration:underline;background:#fff}
-->
</style> 
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript"><!--


//绘图并标记

   var map;
   var image = '../images/jxwd.jpg';
   var screenZoom  = 12;   
   if(screen.height > 1000) screenZoom = 14;//依据屏幕高度设置缩放比例 
    
    //初始化google地图
    function initialize() {

        var latlng = new google.maps.LatLng(32.39421, 119.41296599999998);
        var myOptions = {
            zoom: screenZoom,//缩放比例
            center: latlng,//中心经纬度 
            mapTypeId: google.maps.MapTypeId.ROADMAP //地图类型 ?MapTypeId.ROADMAP ?MapTypeId.SATELLITE ?MapTypeId.HYBRID ?MapTypeId.TERRAIN 
    
        }      
        map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
   
    }

    //添加点击标记监听事件
    function addListener(pointMarker , map,lat,acId,papernum){
     google.maps.event.addListener(pointMarker, 'click', function (){
      if(papernum==0)alert("该二级热点还没有图纸！");
      else{
      if(acId!=null && acId != "")
     	 window.location.href="topology_show.jsp?classTwoACName="+acId;}
     });
    }
    


function show(){
  	 <%
         for (int i = 0;i < vctObj.size(); i++) {
            	Latlng obj1 = vctObj.get(i);
            	String strNameLoca = obj1.getAcName().replace("\n","") + "_"  + obj1.getCheckedLocation();
            	String acId = obj1.getStrAcId(); 
            	System.out.println(strNameLoca+acId);
       %>
      var  strNameLoca = '<%=strNameLoca%>';  
      var nameLoca = strNameLoca.split("_",2);
      var acName =  nameLoca[0];
      var strlatlng = nameLoca[1];
      if(strlatlng!="null"){ 
      var strLatlng = strlatlng.split(",",2);
      var lat = parseFloat(strLatlng[0]);
      var lng = parseFloat(strLatlng[1]);
      var latlng = new google.maps.LatLng(lat,lng);

      map.setZoom(screenZoom);
	  map.setCenter(latlng);
          var  markerOriginal = new google.maps.Marker({
              position: latlng,
              map: map,
              icon:image,
              title:acName,
              animation: google.maps.Animation.DROP //坐标动画效果
          });
          
 	<%int papernum = paper.getPaperNum(" where acname ='"+acId+"'");%>
 	addListener(markerOriginal,map,lat,<%=acId%>,<%=papernum%>);
 	}
    <%
     }
     %> 
 
}
  </script>


<title>WILAN优化分析系统</title>
 </head>

 <body onload="initialize();show(); "> 

 <div id="map_canvas" style="width: 100%; height: 100%"></div>
</body>
</html>
<%@ include file="../include/jsp/footer.jsp"%>
